aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/[lang=lang]/sections/description.svelte
blob: 79a3939f6511ac919d420786228864ed8011a891 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<script context="module" lang="ts">
	export type DescriptionModel = {
		title: string;
		content?: any;
	};
</script>

<script lang="ts">
	import { PortableText } from "@portabletext/svelte";
	export let model: DescriptionModel;

	let visible = true;

	$: if (!model.title) {
		visible = false;
	} else {
		visible = true;
	}
</script>

{#if visible}
	<h3>{model.title}</h3>
	{#if model.content}
		<PortableText value={model.content} />
	{/if}
{/if}